﻿@using IdentityServer4.Extensions
@using Magicodes.Admin.MultiTenancy.Payments
@using Magicodes.Admin.Web.Resources
@model Magicodes.Admin.Web.Models.Payment.PaymentViewModel
@inject IWebResourceManager WebResourceManager
@{
    WebResourceManager.AddScript("https://www.paypalobjects.com/api/checkout.js");
    WebResourceManager.AddScript(ApplicationPath + "view-resources/Views/Payment/_PayPal.js");
}

<input type="hidden" id="paypal-environment" value="@Model.GetAdditionalData(SubscriptionPaymentGatewayType.Paypal, "Environment")" />
<input type="hidden" name="PaymentId" value="" />
<input type="hidden" name="PayerId" value="" />
@if (!Model.GetAdditionalData(SubscriptionPaymentGatewayType.Paypal, "DemoUsername").IsNullOrEmpty())
{
    <div class="note note-info text-center">
        <h4 class="block">@L("DemoPayPalAccount")</h4>
        <p>
            <span>@L("UserName"): <strong>@Model.GetAdditionalData(SubscriptionPaymentGatewayType.Paypal, "DemoUsername")</strong></span><br />
            <span>@L("Password"): <strong>@Model.GetAdditionalData(SubscriptionPaymentGatewayType.Paypal, "DemoPassword")</strong></span>
        </p>
    </div>
}
<div id="paypal-button"></div>